<?php
namespace app\common\util;

use DateTime;
use JsonSerializable;

class JsDataTime extends DateTime implements JsonSerializable
{
    public function jsonSerialize()
    {
        return floatval($this->format('U000'));
    }

    public function __toString()
    {
        return $this->format('Y-m-d H:i:s');
    }
}
